import request from '@/utils/request'

export function getCompanyPage(params) {
    return request({
        url: `/api/v1/core/company/page`,
        method: 'post',
        data: params
    })
}

export function addCompany(params) {
    return request({
        url: `/api/v1/core/company/add`,
        method: 'post',
        data: params
    })
}

export function updateCompany(params) {
    return request({
        url: `/api/v1/core/company/update`,
        method: 'post',
        data: params
    })
}

export function deleteCompany(params) {
    return request({
        url: `/api/v1/core/company/delete?id=${params.id}`,
        method: 'get'
    })
}

export function getCompanyList() {
    return request({
        url: `/api/v1/core/company/list`,
        method: 'get'
    })
}

export function getCompanyTree() {
    return request({
        url: `/api/v1/core/company/tree`,
        method: 'get'
    })
}

export function getCompanyDetail(params) {
    return request({
        url: `/api/v1/core/company/detail?companyId=${params.companyId}`,
        method: 'get'
    })
}
